/**
  ******************************************************************************
  * @author     Chris
  * @since      2024/6/11 12:34
  *
  * @file       pd_timer_it.h
  * @brief      Header file of TimerIT peripheral driver.
  *
  * @note       This file contains the TimerIT object declaration.
  *
  * @warning    None.
  ******************************************************************************
  * Change Logs:
  *   Date          Author       Notes
  *   2024/6/11     Chris        the first version
  *
  ******************************************************************************
  */

#ifndef JLC_SKY_TIMER_IT_H
#define JLC_SKY_TIMER_IT_H

#include "pd_timer.h"

struct TimerITVtbl;

/** @defgroup Object properties
  * @{
  */
typedef struct {
    Timer *timer;

    // TimerIT virtual table
    struct TimerITVtbl *vptr;
} TimerIT;
/**
 * @}
 */

/** @defgroup Object virtual table definition
  * @{
  */
struct TimerITVtbl {
    void (*init)(const TimerIT *this, IRQn_Type irQnType, uint32_t PreemptPriority, uint32_t SubPriority);
};
/**
 * @}
 */

/** @defgroup Object constructor and member function declaration
  * @{
  */
void TimerIT_constructor(TimerIT *this, Timer *timer);
/**
 * @}
 */

/** @defgroup Object virtual table function implementation
  * @{
  */
static inline void TimerIT_init(const TimerIT *this,
                                IRQn_Type irQnType, uint32_t PreemptPriority, uint32_t SubPriority) {
    this->vptr->init(this, irQnType, PreemptPriority, SubPriority);
}
/**
 * @}
 */


#endif //JLC_SKY_TIMER_IT_H
